import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;


public class Open_DeleteMenuListener implements MenuListener{
	MultiDraw2 md;
	String text;
	Open_DeleteMenuListener(MultiDraw2 md, String text){
		this.md = md;
		this.text = text;
	}
	public void menuCanceled(MenuEvent e) {
			md.openMenu.removeAll();
			md.deleteMenu.removeAll();
			md.downloadMenu.removeAll();
	}
	public void menuDeselected(MenuEvent e) {
			md.openMenu.removeAll();
			md.deleteMenu.removeAll();
			md.downloadMenu.removeAll();
	}

	public void menuSelected(MenuEvent e) {
		if(text.equals("open")){
			md.open0_delete1_download2_toggle = 0;
			md.openMenu.removeAll();	
		}else if(text.equals("delete")){
			md.open0_delete1_download2_toggle = 1;
			md.deleteMenu.removeAll();		
		}else if(text.equals("download")){
			md.open0_delete1_download2_toggle = 2;
			md.downloadMenu.removeAll();
		}
		md.mdUser.remoteOut.println("<<GETALLFILENAMES>>");
	}
	

	

}
